﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Usuarios/MasterUsuario.master" AutoEventWireup="true" CodeBehind="CadastroProduto.aspx.cs" Inherits="AuctionSite.Usuarios.CadastroProduto" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <asp:ScriptManager ID="ScriptManager1" runat="server" 
        EnableScriptGlobalization="True">
    </asp:ScriptManager>    
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js"></script>  
    <script src="../Scripts/maskMoney.js" type="text/javascript"></script>


<script type="text/javascript">
    $(document).ready(function () {
        $("#MainContent_ContentPlaceHolder1_txtValorInicial").maskMoney(
            {
                symbol: 'R$ ',
                showSymbol: true,
                thousands: '.',
                decimal: ',',
                symbolStay: true
            }
         )

    });
</script>
<script type="text/javascript">
    function validaData() {
        var data_1 = document.getElementById("MainContent_ContentPlaceHolder1_txtDataInicial").value;
        var data_2 = document.getElementById("MainContent_ContentPlaceHolder1_txtDataFinal").value;
        var Compara01 = parseInt(data_1.split("/")[2].toString() + data_1.split("/")[1].toString() + data_1.split("/")[0].toString());
        var Compara02 = parseInt(data_2.split("/")[2].toString() + data_2.split("/")[1].toString() + data_2.split("/")[0].toString());

       
        if ((Compara01 < Compara02) || (Compara01 == Compara02)) {
            return true;
        } else {
        return false;
        }

    }

</script>

    <asp:Label ID="Label1" runat="server" Text="Nome do Produto"></asp:Label>
    <asp:TextBox ID="txtNome" runat="server"></asp:TextBox>
    &nbsp;<asp:RequiredFieldValidator ID="Valida_Nome" runat="server" 
        ControlToValidate="txtNome" ErrorMessage="* Obrigatório" ForeColor="Red"></asp:RequiredFieldValidator>        
    <br />
   
    <asp:Label ID="lblDesc" runat="server" Text="Descrição"></asp:Label>
    <asp:TextBox ID="txtDesc" runat="server" TextMode="MultiLine"></asp:TextBox>
    <asp:RequiredFieldValidator ID="Valida_Desc" runat="server" 
        ControlToValidate="txtDesc" ErrorMessage="* Obrigatório" ForeColor="Red"></asp:RequiredFieldValidator>
    <br />
    <br />
    <br />
    <div>
    <asp:UpdatePanel ID="panelcat" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="ddlcat" AutoPostBack ="true" AppendDataBoundItems="true"  runat="server" Height="20px" Width="156px" onselectedindexchanged="ddlcat_SelectedIndexChanged">
            </asp:DropDownList>
        </ContentTemplate>
      <Triggers>
       <asp:AsyncPostBackTrigger ControlID ="ddlcat" />
      </Triggers>
  </asp:UpdatePanel>

  <br />
    <asp:UpdatePanel ID="panelsub" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="ddlsub" AutoPostBack ="true" AppendDataBoundItems="true"  runat="server" Height="20px" Width="156px">
            </asp:DropDownList>
        </ContentTemplate>
      <Triggers>
       <asp:AsyncPostBackTrigger ControlID ="ddlsub" />
      </Triggers>
  </asp:UpdatePanel>
 </div>
    <br />
    <br />
    <asp:FileUpload ID="fup1" runat="server" />
    <br />
    
    <br />
    
    <asp:Label ID="lblValorInicial" runat="server" Text="Valor Inicial:"></asp:Label>
    &nbsp;<asp:TextBox ID="txtValorInicial" runat="server"></asp:TextBox>
     <asp:RequiredFieldValidator ID="Valida_Valor" runat="server" 
        ControlToValidate="txtValorInicial" ErrorMessage="* Obrigatório" ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <br />
    <asp:Label ID="Label2" runat="server" Text="Data Inicial:"></asp:Label>
    &nbsp;
    <asp:TextBox ID="txtDatainicial" runat="server" TextMode="SingleLine" 
    Height="19px" Width="69px"></asp:TextBox>    
    <asp:CalendarExtender ID="txtDataInicial_CalendarExtender" runat="server" 
        Enabled="True" TargetControlID="txtDatainicial">
    </asp:CalendarExtender>
    <asp:TextBox ID="txtHoraInicial" runat="server" TextMode="SingleLine" 
    Height="19px" Width="69px"></asp:TextBox>    
    <asp:MaskedEditExtender ID="txtHoraInicial_MaskedEditExtender" 
    runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
    Mask="99:99" MaskType="Time" TargetControlID="txtHoraInicial" 
    UserTimeFormat="TwentyFourHour" InputDirection="RightToLeft">
</asp:MaskedEditExtender>
<br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     <asp:RequiredFieldValidator ID="Valida_Valor0" runat="server" 
        ControlToValidate="txtDatainicial" ErrorMessage="* Obrigatório" 
        ForeColor="Red"></asp:RequiredFieldValidator>
    &nbsp;<asp:RequiredFieldValidator ID="Valida_Valor2" runat="server" 
        ControlToValidate="txtHoraInicial" ErrorMessage="* Obrigatório" 
        ForeColor="Red"></asp:RequiredFieldValidator>
    <br />
    <asp:Label ID="lblDataFinal" runat="server" Text="Data Final:"></asp:Label>
    &nbsp;&nbsp;
    <asp:TextBox ID="txtDataFinal" runat="server" TextMode="SingleLine" 
    Height="17px" Width="70px"></asp:TextBox>
    <asp:TextBox ID="txtHoraFinal" runat="server" TextMode="SingleLine" 
    Height="20px" Width="67px"></asp:TextBox>
    <asp:MaskedEditExtender ID="txtHoraFinal_MaskedEditExtender" runat="server" 
    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
    Mask="99:99" MaskType="Time" TargetControlID="txtHoraFinal" 
    UserTimeFormat="TwentyFourHour" InputDirection="RightToLeft">
</asp:MaskedEditExtender>
<br />
    <asp:CalendarExtender ID="txtDataFinal_CalendarExtender" runat="server" 
        Enabled="True" TargetControlID="txtDataFinal">
    </asp:CalendarExtender>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     <asp:RequiredFieldValidator ID="Valida_Valor1" runat="server" 
        ControlToValidate="txtDataFinal" ErrorMessage="* Obrigatório" 
        ForeColor="Red"></asp:RequiredFieldValidator>
    &nbsp;
     <asp:RequiredFieldValidator ID="Valida_Valor3" runat="server" 
        ControlToValidate="txtHoraFinal" ErrorMessage="* Obrigatório" 
        ForeColor="Red"></asp:RequiredFieldValidator>
    <br />
    <asp:RadioButtonList ID="rbTipo" runat="server">
        <asp:ListItem Selected="True" Value="F">Normal</asp:ListItem>
        <asp:ListItem Value="T">Reverso</asp:ListItem>
    </asp:RadioButtonList>
    <br />
    <br />
    <br />
    <asp:Button ID="btnCadastrar" runat="server" onclick="btnCadastrar_Click" 
        Text="Cadastrar" />
    <br />
</asp:Content>

